]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: make the categories list scrollable, if necessary
authorDan Winship <danw@gnome.org>
Tue, 14 Jun 2011 20:02:36 +0000 (16:02 -0400)
committerDan Winship <danw@gnome.org>
Tue, 5 Jul 2011 17:49:01 +0000 (13:49 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=651082

js/ui/appDisplay.js

index c08e956dbc77bd9869bbf3b6820bada8d08886ad..5f38de3a114efde14659bbb067fa6fd285ac1aad 100644 (file)
@@ -172,10 +172,12 @@ ViewByCategories.prototype = {
         // (used only before the actor is mapped the first time)
         this._currentCategory = -2;
         this._filters = new St.BoxLayout({ vertical: true, reactive: true });
-        this._filters.connect('scroll-event', Lang.bind(this, this._scrollFilter));
-
+        this._filtersBox = new St.ScrollView({ x_fill: false,
+                                               y_fill: false,
+                                               style_class: 'vfade' });
+        this._filtersBox.add_actor(this._filters);
         this.actor.add(this._view.actor, { expand: true, x_fill: true, y_fill: true });
-        this.actor.add(this._filters, { expand: false, y_fill: false, y_align: St.Align.START });
+        this.actor.add(this._filtersBox, { expand: false, y_fill: false, y_align: St.Align.START });
 
         // Always select the "All" filter when switching to the app view
         this.actor.connect('notify::mapped', Lang.bind(this,
@@ -193,14 +195,6 @@ ViewByCategories.prototype = {
         this.actor.add(this._focusDummy);
     },
 
-    _scrollFilter: function(actor, event) {
-        let direction = event.get_scroll_direction();
-        if (direction == Clutter.ScrollDirection.UP)
-            this._selectCategory(Math.max(this._currentCategory - 1, -1))
-        else if (direction == Clutter.ScrollDirection.DOWN)
-            this._selectCategory(Math.min(this._currentCategory + 1, this._sections.length - 1));
-    },
-
     _selectCategory: function(num) {
         if (this._currentCategory == num) // nothing to do
             return;